Attribute VB_Name = "basRegistry"
Attribute VB_Ext_KEY = "RVB_UniqueId" ,"3521FCF5033E"
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'%  VB4 Registry Editor Demo                                            %
'%  MSVC 2.2 Registry Constants and API Prototypes                      %
'%  Written by Roger Wynn                                               %
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

'NOTE:
'Additional Registry Constants can be found in 'WINNT.H'.
'Additional Error Constants can be found in and 'WINERROR.H'.
'Additional Structures and Prototypes can be found in 'WIN32API.TXT',
'  but may need to be modified.

'Registry Constants
'##ModelId=3521FCF70398
Public Const HKEY_CLASSES_ROOT = &H80000000
'##ModelId=3521FCF8008C
Public Const HKEY_CURRENT_USER = &H80000001
'##ModelId=3521FCF800BE
Public Const HKEY_LOCAL_MACHINE = &H80000002
'##ModelId=3521FCF8012C
Public Const HKEY_USERS = &H80000003

'Registry Specific Access Rights
'##ModelId=3521FCF80168
Public Const KEY_QUERY_VALUE = &H1
'##ModelId=3521FCF8019A
Public Const KEY_SET_VALUE = &H2
'##ModelId=3521FCF80208
Public Const KEY_CREATE_SUB_KEY = &H4
'##ModelId=3521FCF80244
Public Const KEY_ENUMERATE_SUB_KEYS = &H8
'##ModelId=3521FCF80276
Public Const KEY_NOTIFY = &H10
'##ModelId=3521FCF802E4
Public Const KEY_CREATE_LINK = &H20
'##ModelId=3521FCF80320
Public Const KEY_ALL_ACCESS = &H3F

'Open/Create Options
'##ModelId=3521FCF80352
Public Const REG_OPTION_NON_VOLATILE = 0&
'##ModelId=3521FCF803C0
Public Const REG_OPTION_VOLATILE = &H1

'Key creation/open disposition
'##ModelId=3521FCF9000A
Public Const REG_CREATED_NEW_KEY = &H1
'##ModelId=3521FCF90078
Public Const REG_OPENED_EXISTING_KEY = &H2

'masks for the predefined standard access types
'##ModelId=3521FCF900B4
Public Const STANDARD_RIGHTS_ALL = &H1F0000
'##ModelId=3521FCF90122
Public Const SPECIFIC_RIGHTS_ALL = &HFFFF

'Define severity codes
'##ModelId=3521FCF90154
Public Const ERROR_SUCCESS = 0&
'##ModelId=3521FCF90190
Public Const ERROR_ACCESS_DENIED = 5
'##ModelId=3521FCF901FE
Public Const ERROR_NO_MORE_ITEMS = 259

'Predefined Value Types
'##ModelId=3521FCF90230
Public Const REG_NONE = (0)                         'No value type
'##ModelId=3521FCF9026C
Public Const REG_SZ = (1)                           'Unicode nul terminated string
'##ModelId=3521FCF902DA
Public Const REG_EXPAND_SZ = (2)                    'Unicode nul terminated string w/enviornment var
'##ModelId=3521FCF9030C
Public Const REG_BINARY = (3)                       'Free form binary
'##ModelId=3521FCF90348
Public Const REG_DWORD = (4)                        '32-bit number
'##ModelId=3521FCF903B6
Public Const REG_DWORD_LITTLE_ENDIAN = (4)          '32-bit number (same as REG_DWORD)
'##ModelId=3521FCFA0000
Public Const REG_DWORD_BIG_ENDIAN = (5)             '32-bit number
'##ModelId=3521FCFA003C
Public Const REG_LINK = (6)                         'Symbolic Link (unicode)
'##ModelId=3521FCFA00AA
Public Const REG_MULTI_SZ = (7)                     'Multiple Unicode strings
'##ModelId=3521FCFA00DC
Public Const REG_RESOURCE_LIST = (8)                'Resource list in the resource map
'##ModelId=3521FCFA0118
Public Const REG_FULL_RESOURCE_DESCRIPTOR = (9)     'Resource list in the hardware description
'##ModelId=3521FCFA0186
Public Const REG_RESOURCE_REQUIREMENTS_LIST = (10)


'Structures Needed For Registry Prototypes
Type SECURITY_ATTRIBUTES
  nLength As Long
  lpSecurityDescriptor As Long
  bInheritHandle As Boolean
End Type

Type FILETIME
  dwLowDateTime As Long
  dwHighDateTime As Long
End Type


'Registry Function Prototypes
'##ModelId=3521FCFA01F4
Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long

'##ModelId=3521FCFD02E4
Declare Function RegSetValueEx Lib "advapi32" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, ByVal szData As String, ByVal cbData As Long) As Long

'##ModelId=3521FD0101D6
Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long

'Change here
'##ModelId=3521FD02015E
Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal szData As String, ByRef lpcbData As Long) As Long

'##ModelId=3521FD06005A
Declare Function RegCreateKeyEx Lib "advapi32" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, phkResult As Long, lpdwDisposition As Long) As Long

'##ModelId=3521FD0B0168
Declare Function RegEnumKeyEx Lib "advapi32.dll" Alias "RegEnumKeyExA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpName As String, lpcbName As Long, ByVal lpReserved As Long, ByVal lpClass As String, lpcbClass As Long, lpftLastWriteTime As FILETIME) As Long

'##ModelId=3521FD1000BE
Declare Function RegEnumValue Lib "advapi32.dll" Alias "RegEnumValueA" (ByVal hKey As Long, ByVal dwIndex As Long, ByVal lpValueName As String, lpcbValueName As Long, ByVal lpReserved As Long, lpType As Long, ByVal lpData As String, lpcbData As Long) As Long

'##ModelId=3521FD15008C
Declare Function RegDeleteKey Lib "advapi32.dll" Alias "RegDeleteKeyA" (ByVal hKey As Long, ByVal lpSubKey As String) As Long

'##ModelId=3521FD1602DA
Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long

'##ModelId=3521FD18010E
Declare Function Num2Bin Lib "QPRO32.DLL" (ByVal Number As Long) As String

'##ModelId=3521FD1900C8
Declare Function Bin2Num Lib "QPRO32.DLL" (ByVal Binary As String) As Long



